hvm: Choose correct shared_info format for 32-bit PV drivers on 64-bit Xen.
authorKeir Fraser <keir@xensource.com>
Tue, 24 Apr 2007 21:00:45 +0000 (22:00 +0100)
committerKeir Fraser <keir@xensource.com>
Tue, 24 Apr 2007 21:00:45 +0000 (22:00 +0100)
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/hvm.c

index bf6ec538aa086938502b4d6442a84e7aaf5721d1..bfde91ef40662f07fadca11cdf0a6f9c0f20beb5 100644 (file)
@@ -1049,6 +1049,15 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
                 break;
             case HVM_PARAM_CALLBACK_IRQ:
                 hvm_set_callback_via(d, a.value);
+#if defined(__x86_64__)
+                /*
+                 * Since this operation is one of the very first executed
+                 * by PV drivers on initialisation or after save/restore, it
+                 * is a sensible point at which to sample the execution mode of
+                 * the guest and latch 32- or 64-bit format for shared state.
+                 */
+                d->is_compat = (hvm_guest_x86_mode(current) == 4);
+#endif
                 break;
             }
             d->arch.hvm_domain.params[a.index] = a.value;